package com.cooldatasoft.domain.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cooldatasoft.domain.dao.TaskDao;
import com.cooldatasoft.domain.model.Project;
import com.cooldatasoft.domain.model.Task;
import com.cooldatasoft.domain.model.User;
import com.cooldatasoft.domain.service.TaskService;


@Service("taskService")
public class TaskServiceImpl implements TaskService {
	
	@Autowired
	private TaskDao taskDao;

	public Long insertTask(Task task) {
		return taskDao.insert(task);
	}

	public void updateTask(Task task) {
		taskDao.update(task);		
	}

	public void deleteTask(Long taskId) {
		taskDao.delete(taskId);		
	}

	public List<Task> getAllTask() {
		return taskDao.getAll();
	}

	@Override
	public List<Task> getTasksToProject(Project project) {
		return taskDao.getTasksToProject(project);
	}

	@Override
	public Task getById(Long id) {
		return taskDao.getById(id);
	}

	@Override
	public List<Task> getTasksToUser(User user) {
		return taskDao.getTasksToUser(user);
	}

	@Override
	public List<Task> getTasksOnProjectWithUser(User user, Project project) {
		return taskDao.getTasksOnProjectWithUser(user, project);
	}

	@Override
	public List<Task> getTasksByTaskStatusOnProject(String taskStatus,
			Project project) {
		
		return taskDao.getTasksByTaskStatusOnProject(taskStatus, project);
	}
	

}
